import React, { PureComponent } from "react";
import * as eCharts from "echarts";
import Home from "./Home";

export default class App extends PureComponent {

  eChartsRef: any = React.createRef();

  componentDidMount() {
    const myChart = eCharts.init(this.eChartsRef.current);

    let option = {
      xAxis: {
        type: 'category',
        data: ['6-28','6-29','6-30','7-1','7-2']
      },
      yAxis: {
        type: 'value'
      },
      series: [
        {
          data: [0, 2000, 4000, 6000, 8000, 10000 ],
          type: 'line',
          smooth: true
        }
      ]
    };

    myChart.setOption(option);
  }
  render() {
      return (
        <div ref={this.eChartsRef} className="Home-echarts"></div>
      )
    }
}
